package cn.train.controler;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.train.model.Contable;
import cn.train.service.ContableService;
@WebServlet("/DelContServlet")
public class DelContServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//		String luid=req.getParameter("leftuid");
//		int uid=Integer.parseInt(luid);
		String cname=req.getParameter("cname");
		ContableService contableService=new ContableService();
		boolean flag=contableService.delCont(cname);
		if(flag) {
			req.getRequestDispatcher("/GetContServlet").forward(req, resp);
		}
	
	}
	
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doGet(req,resp);
	}

}
